<template>
	<view>
		<u-navbar :background="background" :borderBottom="false" :title="type==0?'平台协议':type==1?'隐私政策':'法律声明'" :title-bold="true"></u-navbar>
		<view class="content">
			<view class="" v-html="content"></view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				background:{backgroundColor: '#ffffff',},
				type:0,
				content:"",//内容
				
			}
		},
		onLoad(e) {
			if(e.type){
				this.type=e.type
			}
			this.getinfo() //获取协议
		},
		methods: {
			getinfo(){ //获取协议
				this.$myRequest('user/article',{})
				.then(res=>{
					console.log(res.data);
					if(res.data.code==1){
						let data=res.data.data
						if(this.type==0){ //用户协议
							this.content=data.service
						}else if(this.type==1){ //隐私政策
							this.content=data.privacy
						}else{ //法律声明
							this.content=data.statement
						}

					}
					
				})
			},
			
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #fafafa;
	}
.content{
	padding: 10px 15px;
}

</style>
